<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>top</title>
</head>
<body>
	<button id='top'>top</button>
	<button id='left'>left</button>
	<button id='right'>right</button>
</body>
<script>
	/*谷歌浏览器不兼容*/
	//点击按钮，对应的frames，改变颜色
	topobj=document.getElementById('top');
	leftobj=document.getElementById('left');
	rightobj=document.getElementById('right');
	topobj.onclick=function(){
		objs=window.top.frames; //获取到的是数组。取数组的值是：属性+下标
		//alert(objs);
		objs[0].document.body.style.background='#f00';
	}
	leftobj.onclick=function(){
		objs=window.top.frames; 
		objs[1].document.body.style.background='#0f0';
	}

	rightobj.onclick=function(){
		objs=window.top.frames; 
		objs[2].document.body.style.background='#00f';
	}
</script>
</html>